<?php
namespace Api\Controller;
use Think\Controller;

class JobController extends BaseController {

   private $m = NULL;
   private $md = NULL;
   private $navName = '订单管理';


   public function _initialize(){
   		parent::_initialize();
		$this->m = M('shop_job');
		$this->md = M('shop_detail');
		
		
   }
    	 	
	/**   聚餐美食-猜你喜欢  liuq
	*
	*/	
  
   public  function slist(){
     $page  = I('page');//页码
       //$cid = I('cid');//  用户标识  member id
     $data = $this->m->where()->order('add_time desc')->page($page.',2')->select();      
  
       foreach( $data as $key => $item){
         $data1[$key]['shop_name'] = M('shop')->where('mid="'.$item['mid'].'"')->getField('shop_name');
           $data1[$key]['id'] = $item['id']; 
             $data1[$key]['title'] = $item['title'];
               $data1[$key]['require'] = $item['require'];
                 $data1[$key]['add_time'] = $item['add_time'];
                      $data[$key]['shop_id'] = M('shop')->where('mid="'.$item['mid'].'"')->getField('id');
                       $data1[$key]['shop_heapic'] = $this->md->where("s_id=".$data[$key]['shop_id'])->getField('shop_heapic')?__VUPLOAD__.'shop_heapic/'.$this->md->where("s_id=".$data[$key]['shop_id'])->getField('shop_heapic'):""; //店铺头像
                  }
                 
                //  dump($data1);exit;
    returnApiData2('0','成功',$data1, $data2,$data3);exit;	     
       
   }
   
   
   public function job_detail(){
      $id = I('id');//兼职id
      $dataInfo = $this->m->where('id="'.$id.'"')->find();
    
      $data['title'] = $dataInfo['title'];
      $data['rqueire'] = $dataInfo['require'];
      $data['intro'] = $dataInfo['intro'];
      $data['add_time'] = $dataInfo['add_time'];
    
      returnApiData2('0','成功',$data, $data2,$data3);exit;
      
      
   }
      
     

}